1. Field of the Invention
The present invention relates to an image processor and a command processing method.
2. Description of the Related Art
Among various kinds of signal processing executed by an image processor on input image data, there is processing executed according to pixel positions of processing target image data. For example, in some case, image data of a Bayer array in which a 2×2 pixel array (pattern) is “R”, “GR”, “GB”, and “B” in order from the upper left is received as input image data and processing corresponding to pixel positions and colors of the pixels is applied to values (image data) corresponding to the pixels. As a more specific example, positions of GR, GB, and B pixels are filled with interpolated R pixels by using values of R pixels around the positions to form a single color image. In such a case, the image processor determines positions of the pixels and performs interpolation processing according to a determination result. Specifically, the image processor performs processing for determining a pixel position to thereby determine whether a pixel is an R pixel and, when the pixel is a G pixel (a GR or GB pixel) or a B pixel other than the R pixel, performs interpolation processing. The image processor performs the series of processing (the processing for determining a pixel position and the interpolation processing performed according to a determination result) by executing commands according to steps explained below.    Step 1: Execute a command for loading a vertical position (hereinafter represented as “v”) and a horizontal position (hereinafter represented as “h”) in an image of a processing target pixel to a general-purpose register.    Step 2: Execute a command for loading a relative processing position from image input of a present processing thread to the general-purpose register.    Step 3: Execute a command for performing arithmetic operation of values acquired at step 1 and step 2 to thereby calculate a pixel position of the processing thread and loading the obtained pixel position to the general-purpose register.    Step 4: Execute a command for checking, concerning the pixel position calculated at step 3, whether “v” of the pixel position is an even number position and “h” of the pixel position is an odd number position.    Step 5: Execute a command for checking, concerning the pixel position calculated at step 3, whether “v” of the pixel position is an odd number position.    Step 6: Execute a command for implementing the OR operation of results at steps 4 and 5.    Step 7: Execute a command for instructing, when a result at step 6 is correct, signal processing (interpolation processing) to be executed to branch to a described position and instructing, when the result is not correct, the signal processing not to branch (as a result, the interpolation processing is not performed).
The steps of the interpolation processing for filling the positions of GR, GB, and B pixels with interpolated R pixels using values of R pixels around the positions are explained. However, when the signal processing is applied to only a pixel in a specific position, processing equivalent to steps 1 to 6 is necessary as branch determination processing necessary before the signal processing is performed.
As explained above, to determine whether the signal processing should be applied to a pixel in a specific position (branch determination), the image processor in the past needs to execute the commands at steps 1 to 6 as processing at a pre-stage of the determination (processing for specifying a position of a processing target pixel and determining whether the signal processing should be executed). In other words, it is necessary to execute a large number of commands and an overall calculation amount increases. On the other hand, because the image processor tends to treat image data of a larger size, a reduction in the calculation amount is a problem. Therefore, it is requested to efficiently perform the signal processing and reduce such a calculation amount.
Japanese Patent Application Laid-Open No. H7-49961 discloses a technology for determining a position (a coordinate) of a processing target and executing various kinds of processing according to a determination result and, specifically, a processor for three-dimensional graphic acceleration that determines three-dimensional coordinate information included in input data and performs rendering processing corresponding to a determination result. However, in this processor, a reduction in the calculation amount is not taken into account.